﻿using System.Collections.Generic;
using WindowsForms.AOnline.Model;
using WindowsForms.AOnline.Model.BusinessObjects.Dictionary;
using DevExpress.XtraEditors;
using MaiLinh.RSSHelper;
using WindowsForms.AOnline.Model.BusinessObjects.Report.Stock;
using WindowsForms.AOnline.Report.ParameterReportForm;
using WindowsForms.AOnline.Session;

namespace WindowsForms.AOnline.Report.ReportClass
{
    public class StockReport : BaseReport
    {
        public StockReport()
        {
            Model = new Model.Model();
        }

        /// <summary>
        /// Gets the fixed asset category list.
        /// </summary>
        /// <param name="frmParent">The FRM parent.</param>
        /// <param name="commonVariable">The common variable.</param>
        /// <param name="oRsTool">The o rs tool.</param>
        /// <returns></returns>
        public IList<StockBacklogModel> GetStockBacklogList(XtraForm frmParent, Session.GlobalVariable commonVariable, ReportSharpHelper oRsTool)
        {
            IList<StockBacklogModel> list = new List<StockBacklogModel>();
            using (var frmParam = new FrmStockBacklog())
            {
                frmParam.ShowDialog();
                var fromDate = frmParam.FromDate;
                var toDate = frmParam.ToDate;
                var listStockId = frmParam.ListStockId;
                var stockName = frmParam.StockName;
                //oRsTool.Parameters.Add("StockName", stockName);
                //oRsTool.Parameters.Add("FromDate", fromDate);
                //oRsTool.Parameters.Add("ToDate", toDate);
                list = Model.GetStockBacklog(fromDate, toDate, listStockId);
                
            }
            return list;
        }

        
    }
}
